package com.atstudent.gmall.product.controller;

import com.atstudent.gmall.common.result.Result;
import com.atstudent.gmall.common.result.ResultCodeEnum;
import com.atstudent.gmall.product.entity.BaseCategory3;
import com.atstudent.gmall.product.service.BaseCategory3Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 查询三级分类
 * @ClassName：BaseCategory3Controller
 * @Dexcription
 * @Author 薛有朋
 * @CreatDate 2024/11/17 21:19
 **/
@RestController
@RequestMapping(value = "/admin/product")
public class BaseCategory3Controller {

    @Autowired
    private BaseCategory3Service baseCategory3Service;

    /**
     * 查询三级分类
     * @Author 薛有朋
     * @Date 2024/11/23 16:10
     **/
    @GetMapping(value = "/getCategory3/{category2Id}")
    public Result<List<BaseCategory3>> findBaseCategory3ByC2Id(@PathVariable(value = "category2Id") Long c2Id){
        List<BaseCategory3> baseCategory3List = baseCategory3Service.findBaseCategory3ByC2Id(c2Id);
        return Result.ok(baseCategory3List);
    }

}
